

import  {ref, computed} from 'vue'



import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const count = ref(0)
  function increment() {
    count.value++
    alert(123)
    console.log(`output->count.value`,count.value)
  
  }

  return { count, increment }
})


export   const useLoginStore = defineStore('loginStore', ()=>{
// 声纹识别登录
const voiceVisible = ref(false);
// 人脸识别登录
const faceVisible = ref(false);
// 默认表单登录方式
const formVisible = ref(true)


// 设置声音的显示方式

const setvoiceState = () => {
    voiceVisible.value = true
    faceVisible.value = false
    formVisible.value = false
}
// 面部识别
const setfaceState = () => {
 
    faceVisible.value = true
    voiceVisible.value = false
    formVisible.value = false
    console.log(faceVisible.value, voiceVisible.value ,formVisible.value )
}
const setformState = () => {
    formVisible.value = true
    voiceVisible.value = false
    faceVisible.value = false
}


let  isvoiceVisible = computed(()=>{
    console.log(`voiceVisible声音发生了改变`)
    return voiceVisible.value
})
let  isfaceVisible = computed(()=>{
    console.log(`faceVisible发生了改变`)
    return  faceVisible.value
})
let  isformVisible = computed(()=>{
    console.log(`formVisible发生了改变`)
    return  formVisible.value
})

return {
    isvoiceVisible, setvoiceState, 
    isfaceVisible,setfaceState,
    isformVisible,setformState,
}


})